<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>-->
<!--<%@ taglib prefix="s" uri="/struts-tags"%>-->
<!--<%-->
<!--	String path = request.getContextPath();-->
<!--	String basePath = request.getScheme() + "://"-->
<!--			+ request.getServerName() + ":" + request.getServerPort()-->
<!--			+ path + "/";-->
<!--%>-->

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<!--    <base href="<%=basePath%>">-->

    <title>编辑权限</title>

    <meta name="pragma" content="no-cache">
    <meta name="cache-control" content="no-cache">
    <meta name="expires" content="0">
    <!--<%@include file="../../script.html"%>-->
    <link th:insert="~{views/script :: tiancai}"/>
</head>
<style type="text/css">
    .myselect {
        height: 30px;
    }
</style>

<body style="width:100%;max-width:100%;padding:10px 30px;">
<form id="form" method="post">
    <strong>主要信息</strong>
    <section class="info-section">

        <table id="tb">
            <tr>
                <td class="text-title">负责人</td>
                <td class="text-content">
                    <input type="hidden" name="id" th:value="${busiVO.getId()}">
<!--                    <input type="hidden" name="createTime" th:value="${busiVO.getCreateTime() }">-->
<!--                    <input type="hidden" name="busiVO.createById" th:value="${ }">-->
                    <select class="myselect" name="ownerUserId">
                        <option
                                th:each="u:${list}"
                                th:value="${u.getId()}"
                                th:selected="${u.getId()==busiVO.getOwnerUserId()}"
                        >[[${u.getUserName()}]]</option>
                    </select>
                </td>
                <td class="text-title">客户</td>
                <td class="text-content">
                    <select class="myselect" name="customerId">
                        <option
                                th:each="cu:${cus}"
                                th:value="${cu.getId()}"
                                th:selected="${cu.getId()==busiVO.getCustomerId()}"
                        >[[ ${cu.getCustomerName()} ]]</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-title">商机金额</td>
                <td class="text-content">
                    <input type="text" name="salesPrice" th:value="${busiVO.getSalesPrice() }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:false">
                </td>
                <td class="text-title">商机名</td>
                <td class="text-content">
                    <input type="text" name="name" th:value="${busiVO.getBname() }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:false">
                </td>
            </tr>
            <tr>
                <td class="text-title">联系人</td>
                <td class="text-content">
                    <select class="myselect" name="contactsId">
                        <option
                                th:each="co:${con}"
                                th:value="${co.getId()}"
                                th:selected="${co.getId()==busiVO.getContactsId()}"
                        >[[${co.getConname()}]]</option>
                    </select>
                    <a href="javascript:void(0)" class="text-title" style="color:blue;">新建</a>
                </td>

            </tr>
            <tr>
                <td class="text-title">合同签订地址</td>
                <td class="text-content" colspan="3">
                    <input type="text" style="width:550px;" name="contractAddress"
                           th:value="${busiVO.getContractAddress() }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:false">
                </td>
            </tr>
            <tr>
                <td class="text-title">商机类型</td>
                <td class="text-content">
                    <select class="myselect" name="type">
                        <option
                                th:each="s:${bus}"
                                th:value="${s.getType()}"
                                th:selected="${s.getType()==busiVO.getType()}"
                        >[[${s.getType()}]]</option>
                    </select>
                </td>
                <td class="text-title">状态</td>
                <td class="text-content">
                    <select class="myselect" name="businessStatusId">
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-title">商机来源</td>
                <td class="text-content">
                    <select class="myselect" name="origin">
                        <option
                                th:each="s:${buss}"
                                th:value="${s.getOrigin()}"
                                th:selected="${s.getOrigin()==busiVO.getOrigin()}"
                        >[[${s.getOrigin()}]]</option>
                    </select>
                </td>
                <td class="text-title">赢单率</td>
                <td class="text-content">
                    <input type="text" name="gainrate" th:value="${busiVO.getGainRate()}"
                           class="easyui-textbox theme-textbox-radius" data-options="required:false">
                </td>
            </tr>
            <tr>
                <td class="text-title">预定成交价</td>
                <td class="text-content">
                    <input type="text" name="estimatePrice" th:value="${busiVO.getEstimatePrice() }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
                <td class="text-title">下次联系时间</td>
                <td class="text-content">
                    <input class="easyui-datetimebox" name="nextstepTime" th:value="${busiVO.getNextstepTime() }"
                           data-options="required:false,showSeconds:false" style="width:150px">
                </td>
            </tr>
            <tr>
                <td class="text-title">下次联系内容</td>
                <td class="text-content">
                    <input type="text" name="nextstep" th:value="${busiVO.getNextstep() }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:false">
                </td>

            </tr>


        </table>

    </section>
    <strong>附加信息</strong>
    <section class="info-section">
        <table>
            <tr>
                <td class="text-title">备注</td>
                <td class="text-content">
                    <textarea name="description" rows="5" style="width:80%;">[[${busiVO.getDescription }]]</textarea>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;margin-top: 10px;">
                    <a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary"
                       style="margin-left:-70px;">保存</a>
                    <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger"
                       style="margin-left:30px;">重置</a>
                </td>
            </tr>
        </table>
    </section>
</form>

<script type="text/javascript" th:inline="none">

    $(function () {
        //重置按钮
        $("#resetBtn").on("click", function (event) {
            $("#form").form("reset");
        });
        //保存按钮
        $("#saveBtn").on("click", function (event) {
            $("#form").form("submit", {
                url: "/manage/business/BusinessAction_saveOrUpdate.action",
                onSubmit: function () {
                    //对表单进行数据校验,如果未通过校验，返回false，阻止表单提交
                    return $(this).form("validate");

                },
                success: function (data) {
                    //data未服务器端返回的字符串数据，eval将字符串数据转换为json对象
                    data = eval("(" + data + ")");
                    if (data.success) {
                        parent.closeTopWindow();
                    }
                }
            });
        });


    });
</script>
</body>
</html>
				